import request from "@/utils/request";
import {GetAllCategoryResponseData} from "./type"
//统一接口
enum API{
   HTTPINTANCE_URL='/home/category/head',
   BANNER_URL='/home/banner',
   NWEGOODS_URL='/home/new',
   HOTGOODS_URL='/home/hot',
   HOTPRODUCTS_URL='/home/brand'
   
}
//获取-全部分类(包含推荐商品)接口
export const reqGetCategory=(distributionSite:string)=>{
    return request.get<any,GetAllCategoryResponseData>(API.HTTPINTANCE_URL,{
      params:{
        distributionSite
      }
    })
}
//获取轮播图接口
export const reqGetBanner =()=>{
    return request.get<any,any>(API.BANNER_URL)
}
//获取所有商品
export const getGoodsAPI = () => {
    return request({
      url: '/home/goods'
    })
  }
//获取-新鲜好物接口
export const reqNewGoods = () => {
    return request.get<any, any>(API.NWEGOODS_URL);
  };
//获取-人气推荐接口
export const reqHotGoods = () => {
  return request.get<any, any>(API.HOTGOODS_URL);
};
//获取-热门品牌接口
export const reqHotProducts = () => {
  return request.get<any, any>(API.HOTPRODUCTS_URL);
};